<template>
  <div class="banner">
    <div class="banner-inner">
      <a-carousel class="carousel" arrows autoplay :autoplay-speed="5000" :pause-on-hover="true">
        <div v-for="(item, index) in carouselItem" :key="item.slogan">
          <div class="carousel-item">
            <div class="carousel-title">{{ item.slogan }}</div>
            <div class="carousel-sub-title">{{ item.subSlogan }}</div>
            <img v-if="index == 0" class="carousel-image" src="../../../assets/images/banner-1.png" />
            <img v-if="index == 1" class="carousel-image" src="../../../assets/images/banner-2.png" />
            <img v-if="index == 2" class="carousel-image" src="../../../assets/images/banner-3.png" />
          </div>
        </div>
      </a-carousel>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { computed } from "vue"
import { useI18n } from "vue-i18n"

const { t } = useI18n()
const carouselItem = computed(() => [
  {
    slogan: t("login.banner.slogan1"),
    subSlogan: t("login.banner.subSlogan1")
  },
  {
    slogan: t("login.banner.slogan2"),
    subSlogan: t("login.banner.subSlogan2")
  },
  {
    slogan: t("login.banner.slogan3"),
    subSlogan: t("login.banner.subSlogan3")
  }
])
</script>

<style lang="scss" scoped>
.banner {
  display: flex;
  justify-content: center;
  align-items: center;
  &-inner {
    flex: 1;
    height: 100%;
    overflow: hidden;
  }
}

.carousel {
  height: 100%;
  &-item {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    flex-direction: column;
  }

  &-title {
    font-size: 20px;
    color: #f7f8fa;
    font-weight: 500;
    line-height: 28px;
  }

  &-sub-title {
    padding: 0 24px;
    margin-top: 8px;
    font-size: 14px;
    color: #c9cdd4;
    line-height: 22px;
  }

  &-image {
    margin-top: 30px;
    width: 320px;
  }
}
:deep(.slick-slide) {
  display: flex !important;
  align-items: center;
  overflow: hidden;
  height: 100vh;
  text-align: center;
  & > div {
    width: 100%;
  }
}
</style>
